package com.Ajava1801D.枚举;

/**
 * @author: LCG
 * 作者: LCG
 * 日期: 2020/10/6  10:13
 * 描述:
 */
public enum MeiJu1 {
    //
    CHUSHIHUA("初始化",0),WEI_JI_HUO("未激活",1),JI_HUO("激活",2);

    private String status;

    private int code;

    MeiJu1(String status, int code) {
        this.status = status;
        this.code = code;
    }


    public String getStatus() {
        return status;
    }

    public int getCode() {
        return code;
    }

    public static String getStatusByCode(int code){

        MeiJu1[] values = MeiJu1.values();

        for (MeiJu1 value : values) {
           if( value.getCode()==code){
              return value.status;
           }
        }

        return null;
    }


    public static MeiJu1 getInstance(){
        return CHUSHIHUA;
    }

}
